/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.ajz.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 检查记录Entity
 * @author cww
 * @version 2019-01-11
 */
@Table(name="ajz_record", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(includeEntity=DataEntity.class),
		@Column(name="other_worker", attrName="otherWorker", label="陪同人员"),
		@Column(name="base_type", attrName="baseType", label="安监类型"),
		@Column(name="deadline", attrName="deadline", label="截止时间"),
		@Column(name="opinion", attrName="opinion", label="整改意见"),
		@Column(name="scene_pic", attrName="scenePic", label="无隐患图片"),
		@Column(name="danger_pic", attrName="dangerPic", label="隐患图片"),
		@Column(name="finish_pic", attrName="finishPic", label="整改图片"),
		@Column(name="base_id", attrName="baseId", label="基础表id"),
		@Column(name="number", attrName="number", label="检查文书编号"),
		@Column(name="contactor_sign", attrName="contactorSign", label="商家签名"),
		@Column(name="worker_sign1", attrName="workerSign1", label="工作人员签名1"),
		@Column(name="worker_sign2", attrName="workerSign2", label="工作人员签名2"),
		@Column(name="cycle_index", attrName="cycleIndex", label="排查轮数"),
		@Column(name="cycle_count", attrName="cycleCount", label="排查次数"),
		@Column(name="cycle_ajz_index", attrName="cycleAjzIndex", label="总轮数"),
		@Column(name="del_flag", attrName="delFlag", label="del_flag"),
	}, orderBy="a.update_date DESC"
)
public class AjzRecord extends DataEntity<AjzRecord> {
	
	private static final long serialVersionUID = 1L;
	private String otherWorker;		// 陪同人员
	private String baseType;		// 安监类型
	private Date deadline;		// 截止时间
	private String opinion;		// 整改意见
	private String scenePic;		// 无隐患图片
	private String dangerPic;		// 隐患图片
	private String finishPic;		// 整改图片
	private String baseId;		// 基础表id
	private String number;		// 检查文书编号
	private String contactorSign;		// 商家签名
	private String workerSign1;		// 工作人员签名1
	private String workerSign2;		// 工作人员签名2
	private String cycleIndex;		// 排查轮数
	private String cycleCount;		// 排查次数
	private String cycleAjzIndex;		// 总轮数
	private String delFlag;		// del_flag
	
	public AjzRecord() {
		this(null);
	}

	public AjzRecord(String id){
		super(id);
	}
	
	@Length(min=0, max=100, message="陪同人员长度不能超过 100 个字符")
	public String getOtherWorker() {
		return otherWorker;
	}

	public void setOtherWorker(String otherWorker) {
		this.otherWorker = otherWorker;
	}
	
	@NotBlank(message="安监类型不能为空")
	@Length(min=0, max=64, message="安监类型长度不能超过 64 个字符")
	public String getBaseType() {
		return baseType;
	}

	public void setBaseType(String baseType) {
		this.baseType = baseType;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getDeadline() {
		return deadline;
	}

	public void setDeadline(Date deadline) {
		this.deadline = deadline;
	}
	
	@Length(min=0, max=1500, message="整改意见长度不能超过 1500 个字符")
	public String getOpinion() {
		return opinion;
	}

	public void setOpinion(String opinion) {
		this.opinion = opinion;
	}
	
	@Length(min=0, max=1000, message="无隐患图片长度不能超过 1000 个字符")
	public String getScenePic() {
		return scenePic;
	}

	public void setScenePic(String scenePic) {
		this.scenePic = scenePic;
	}
	
	@Length(min=0, max=1500, message="隐患图片长度不能超过 1500 个字符")
	public String getDangerPic() {
		return dangerPic;
	}

	public void setDangerPic(String dangerPic) {
		this.dangerPic = dangerPic;
	}
	
	@Length(min=0, max=1500, message="整改图片长度不能超过 1500 个字符")
	public String getFinishPic() {
		return finishPic;
	}

	public void setFinishPic(String finishPic) {
		this.finishPic = finishPic;
	}
	
	@Length(min=0, max=64, message="基础表id长度不能超过 64 个字符")
	public String getBaseId() {
		return baseId;
	}

	public void setBaseId(String baseId) {
		this.baseId = baseId;
	}
	
	@Length(min=0, max=64, message="检查文书编号长度不能超过 64 个字符")
	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}
	
	@Length(min=0, max=500, message="商家签名长度不能超过 500 个字符")
	public String getContactorSign() {
		return contactorSign;
	}

	public void setContactorSign(String contactorSign) {
		this.contactorSign = contactorSign;
	}
	
	@Length(min=0, max=500, message="工作人员签名1长度不能超过 500 个字符")
	public String getWorkerSign1() {
		return workerSign1;
	}

	public void setWorkerSign1(String workerSign1) {
		this.workerSign1 = workerSign1;
	}
	
	@Length(min=0, max=500, message="工作人员签名2长度不能超过 500 个字符")
	public String getWorkerSign2() {
		return workerSign2;
	}

	public void setWorkerSign2(String workerSign2) {
		this.workerSign2 = workerSign2;
	}
	
	@Length(min=0, max=10, message="排查轮数长度不能超过 10 个字符")
	public String getCycleIndex() {
		return cycleIndex;
	}

	public void setCycleIndex(String cycleIndex) {
		this.cycleIndex = cycleIndex;
	}
	
	@Length(min=0, max=10, message="排查次数长度不能超过 10 个字符")
	public String getCycleCount() {
		return cycleCount;
	}

	public void setCycleCount(String cycleCount) {
		this.cycleCount = cycleCount;
	}
	
	@Length(min=0, max=10, message="总轮数长度不能超过 10 个字符")
	public String getCycleAjzIndex() {
		return cycleAjzIndex;
	}

	public void setCycleAjzIndex(String cycleAjzIndex) {
		this.cycleAjzIndex = cycleAjzIndex;
	}
	
	@Length(min=0, max=1, message="del_flag长度不能超过 1 个字符")
	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}
	
	public Date getCreateDate_gte() {
		return sqlMap.getWhere().getValue("create_date", QueryType.GTE);
	}

	public void setCreateDate_gte(Date createDate) {
		sqlMap.getWhere().and("create_date", QueryType.GTE, createDate);
	}
	
	public Date getCreateDate_lte() {
		return sqlMap.getWhere().getValue("create_date", QueryType.LTE);
	}

	public void setCreateDate_lte(Date createDate) {
		sqlMap.getWhere().and("create_date", QueryType.LTE, createDate);
	}
	
}